package main.java.design.mdediator;

/**
 * <p></p>
 *
 * @author : wangdejian
 * @version 1.0
 * @date : 2020/6/22 21:19
 */
public class Client {
    public static void main(String[] args) {
        //构建中介者
        Mediator mediator = new ConcreteMediator();

        //构建具体的同事类
        Colleague colleague1 = new ConcreteColleague1();
        Colleague colleague2 = new ConcreteColleague2();

        //注册同事
        mediator.register(colleague1);
        mediator.register(colleague2);

        //发送消息
        colleague1.send();
        colleague2.send();
    }

}
